﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using BCCommon.OAEnums;
using BCEntity.OA.ApplyOrder;

namespace BCData.OA.ApplyOrder
{
    public interface IApplyOrderData
    {
        /// <summary>
        /// 分页获取申请信息列表
        /// </summary>
        /// <param name="adminId">当前登录人员</param>
        /// <param name="pageIndex">分页页码</param>
        /// <param name="pageSize">分页页数</param>
        /// <param name="ascending">是否升序排</param>
        /// <param name="type">申请类型</param>
        /// <param name="status">申请单审核状态</param>
        /// <param name="isMyApproveed">是否我审批的</param>
        /// <param name="isMyCreated">由我发起的</param>
        /// <param name="isCopierToMe">抄送给我的</param>
        /// <param name="companyId">公司Id</param>
        /// <returns></returns>
        Task<(IEnumerable<ApplyOrderEntity>, int)> GetAsync(long adminId, int pageIndex, int pageSize, bool ascending,
            OAApplyOrderType? type,
            OAApplyOrderStatus? status,
            bool? isMyApproveed,
            bool? isMyCreated,
            bool? isCopierToMe,
            int? companyId);

        /// <summary>
        /// 获取指定的OA申请单
        /// </summary>
        /// <param name="applyOrderId"></param>
        /// <returns></returns>
        Task<ApplyOrderEntity> GetById(long applyOrderId);

        /// <summary>
        /// 更新指定的申请单已读
        /// </summary>
        /// <param name="applyOrderId"></param>
        /// <returns></returns>
        Task<ApplyOrderEntity> UpdateApplyOrderRead(long applyOrderId, string adminName, long adminId);
      
        /// <summary>
        /// 新增一个申请信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<ApplyOrderEntity> InsertAsync(ApplyOrderEntity entity);

        /// <summary>
        /// 更新指定的申请单
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<ApplyOrderEntity> UpdateApprovalAdminIdsAsync(ApplyOrderEntity entity);

        /// <summary>
        /// 更新指定的申请单状态
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<ApplyOrderEntity> UpdateStatusAsync(ApplyOrderEntity entity);
       
        /// <summary>
        /// 获取指定的OA申请单
        /// </summary>
        /// <param name="applyOrderNo">根据申请单号</param>
        /// <returns></returns>
        Task<ApplyOrderEntity> GetByApplyOrderNoAsync(string applyOrderNo);
    }
}
